package com.whfc.emp.dao;

import com.whfc.emp.dto.AppExamAnswerRecordDTO;
import com.whfc.emp.entity.AppExamAnswerRecord;
import com.whfc.emp.entity.AppExamAnswerRecord;
import com.whfc.emp.param.AppExamAnswerRecordListParam;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author: realm
 * @date: 2025-10-22 15:24
 * @description: //todo
 */
public interface AppExamAnswerRecordMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AppExamAnswerRecord record);

    int insertSelective(AppExamAnswerRecord record);

    AppExamAnswerRecord selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AppExamAnswerRecord record);

    int updateByPrimaryKey(AppExamAnswerRecord record);

    /**
     * 获取培训列表
     *
     * @param request
     * @return
     */
    List<AppExamAnswerRecordDTO> selectByParam(AppExamAnswerRecordListParam request);

    /**
     * 删除培训记录
     *
     * @param id
     */
    void deleteLogicById(@Param("id") Integer id);


    /**
     * 根据试卷ID和用户ID查询培训记录
     *
     * @param examPaperId
     * @param userId
     * @return
     */
    AppExamAnswerRecord selectByPaperIdAndUserId(@Param("examPaperId") Integer examPaperId,@Param("userId") Integer userId,@Param("questionId")Integer questionId);

    /**
     * 获取试卷总分
     *
     * @param examPaperId
     * @param userId
     * @return
     */
    Integer getSumCore(@Param("examPaperId") Integer examPaperId,@Param("userId") Integer userId);

    /**
     * 获取试卷总题数
     *
     * @param examPaperId
     * @param userId
     * @return
     */
    Integer selectCount(@Param("examPaperId") Integer examPaperId,@Param("userId") Integer userId);
}